<?php
/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of wrapper
 *
 * @author laimis
 */
class GalleryWrapper {

    public function wraperController(){
        $actionObject = $this->getRequestAction();
        if($actionObject != null){
            switch ($actionObject) {
                case 'add':
                    include_once BASEURL.'action/gallery/add/wrapper.php';
                    new GalleryAddWrapper();
                    break;
                case 'edit':
                    include_once BASEURL.'action/gallery/edit/wrapper.php';
                    new GalleryEditWrapper();
                    break;
                case 'delete':
                    include_once BASEURL.'action/gallery/delete.php';
                    new GalleryDelete();
                    break;
                case 'view':
                    include_once BASEURL.'action/gallery/view.php';
                    new GalleryView();
                    break;
                case 'list':
                    include_once BASEURL.'action/gallery/list.php';
                    new GalleryList();
                    break;
                default:
                    include_once BASEURL.'action/gallery/list.php';
                    new GalleryList();
                    break;
            }
        }else{
            include_once BASEURL.'web/error.php';
            exit ();
        }
    }

    public function getRequestAction(){
        $result = '';
        if(isset ($_REQUEST['request']['action'])){
            $result = $_REQUEST['request']['action'];
        }
        return $result;
    }

    public function GalleryWrapper(){
        $this->wraperController();
    }
}
?>
